package com.cqw.exception;

import com.cqw.enums.ResponseCode;
import lombok.Data;

/**
 * @Author: caoqingwen
 * @CreateTime: 2021-04-30 09:49
 * @Description:
 */
@Data
public class CommonException extends RuntimeException {


    private Integer code;

    private String message;


    public CommonException(String message) {
        this.message = message;
    }


    public CommonException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }


    public CommonException(ResponseCode responseCode) {
        this.code = responseCode.getCode();
        this.message = responseCode.getMessage();
    }

    public CommonException(String message, Throwable e)
    {
        super(message, e);
        this.message = message;
    }
}
